# Support for mob vigilantism
afro$sfmv <- afro$Q12 %in% c(7:8)
afro$sfmv[afro$Q12 %in% c(-1,9995, 9998, 9999)] <- NA

# Gender
afro$Q101
afro$woman <- NA
afro$woman[afro$Q101 == 1] <- 0
afro$woman[afro$Q101 == 2] <- 1
afro$female <- afro$woman

# Country
afro$country <- haven::as_factor(afro$COUNTRY_ALPHA)
afro$region <- haven::as_factor(afro$REGION)

# afro$Q59H - trust in police
table(afro$Q59H,useNA = "always")
afro$trust_police <- afro$Q59H
afro$trust_police[afro$Q59H %in% c(-1, 9)] <- NA
afro$trust_police <- afro$trust_police/3

# afro$Q60E - police corruption
table(afro$Q60E,useNA = "always")
afro$no_police_corrupt <- afro$Q60E
afro$no_police_corrupt[afro$Q60E %in% c(-1, 9)] <- NA
afro$no_police_corrupt <- (3 - afro$no_police_corrupt)/3

# afro$Q67C - difficult to obtain services form the police?
table(afro$Q67C, useNA = "always")
afro$easy_obtain_police_service <- afro$Q67C
afro$easy_obtain_police_service[afro$Q67C %in% c(-1, 9,5)] <- NA
afro$easy_obtain_police_service <- (afro$easy_obtain_police_service -1)/3



